const { toVoice, voices } = require("edge-tts-nodejs")
const path = require("path")
 
// 输出不同的格式文件
toVoice("你好世界", path.resolve('./helloworld.mp3'))
toVoice("你好世界", path.resolve('./helloworld.wav'))
// 使用语音包
toVoice("你好", path.resolve('./voice.wav'), {
  voice: "zh-CN-liaoning-XiaobeiNeural"
})
// 将`你好`这句语音输出到example.wav,使用 zh-CN-liaoning-XiaobeiNeural 语音包，+30%的速率，+10%的音量，及+10Hz的频率，下面是完整的示例
toVoice("你好", path.resolve('./example.wav'), {
  voice: "zh-CN-liaoning-XiaobeiNeural", // use voices() get voice package
  rate: 30, // +30% speak rate
  volume: 10, // +10% sound
  pitch: 10 // +10Hz pitch
})
 
// All Voice List 查询所有语音包
voices()
// about language Voice list 这个是查询某个语言的所有可用语音包
// Option: af am ar az bg bn bs ca cs cy da de el en es et fa fi fil fr ga gl gu he hi hr hu id is it ja jv ka kk km kn ko lo lt lv mk ml mn mr ms mt my nb ne nl pl ps pt ro ru si sk sl so sq sr su sv sw ta te th tr uk ur uz vi zh
voices('zh') // 获取所有中文语音包